import 'package:flutter_test/flutter_test.dart';
import 'package:usbflutter/usbflutter.dart';
import 'package:usbflutter/usbflutter_platform_interface.dart';
import 'package:usbflutter/usbflutter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockUsbflutterPlatform
    with MockPlatformInterfaceMixin
    implements UsbflutterPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final UsbflutterPlatform initialPlatform = UsbflutterPlatform.instance;

  test('$MethodChannelUsbflutter is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelUsbflutter>());
  });

  test('getPlatformVersion', () async {
    Usbflutter usbflutterPlugin = Usbflutter();
    MockUsbflutterPlatform fakePlatform = MockUsbflutterPlatform();
    UsbflutterPlatform.instance = fakePlatform;

    expect(await usbflutterPlugin.getPlatformVersion(), '42');
  });
}
